package com.onpositive.wikidataeditor;

import com.onpositive.mediawiki.propertyparser.ParsedCategory;
import com.onpositive.semantic.model.api.changes.ObjectChangeManager;
import com.onpositive.wikistorage.XMLInterface;

public class Resources {
	
	private ParsedCategory cat ;
	private static Resources instance = new Resources() ;
	
	public static Resources getInstance(){
		return instance ;
	}
	
	private Resources(){} 
	
	public void setWorkingCategory( ParsedCategory cat ) {
		this.cat = cat;
		fireChanges() ;
	}

	public ParsedCategory getWorkingCategory(){
		
		if( cat == null ){
			cat = XMLInterface.loadParsedCategory( "C:\\wikistorage\\raw data serialized.xml" ) ;			
			//cat = XMLInterface.loadParsedCategory( "C:\\wikistorage\\raw data.xml" ) ;
		}
		
		return cat ;
	}
	
	void fireChanges(){
		ObjectChangeManager.markChanged( this ) ;
	}

}
